# -*- coding:utf-8 -*-
"""
Author：Administrator
Date:2023年03月13日
"""
import openpyxl

myBook=openpyxl.load_workbook('录取表.xlsx')
mySheet=myBook['录取表']

myRange=list(mySheet.values)
myDict={}
for myRow in myRange[3:]:
	if myRow[0] in myDict.keys():
		myDict[myRow[0]]+=[myRow]
	else:
		myDict[myRow[0]]=[myRow]

for myKey,myValue in myDict.items():
	myNewBook=openpyxl.Workbook()
	myNewSheet=myNewBook.active
	myNewSheet.append(myRange[2])
	for myRow in myValue:
		myNewSheet.append(myRow)
	mySheet.title=myKey+'录取表'
	myPath='结果表-'+myKey+'录取表.xlsx'
	myNewBook.save(myPath)

